<?php
/**
 * Klasse verantwoordelijk voor
 * beheer sessievariabelen
 * @author oophp
 */
class Sessie{
    /*
     * 
     */
    private $_VARS = array('naam'=>'username','aangemeld'=>false);
    /* 
     * constructor: start de sessie + initieert de sessievariabelen
     * @return void
     */
    public function __construct(){
        session_start();
        foreach ($this->_VARS as $key => $value) {
            if(!isset($_SESSION[$key])){
                $_SESSION[$key]= $value;
            }
        }
    }
    static public function GET($key= ''){
        if(!empty($key)&& isset($_SESSION[$key]))
          return $_SESSION[$key];
        else
            die('FOUT:sessionkey'.$key.' niet gevonden');
    }
    static public function SET($key = '',$value=''){
        if(!empty($key))
            $_SESSION[$key]= $value;
    }
    static public function RESET(){
        $_SESSION = array();
    }
}
?>
